<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%
	String path = request.getContextPath();
%>
<script type="text/javascript">
 	function submitValidate() {
			var ok = confirm('确认登录?');
				if(ok){
					document.Login.submit();
				}
	}		

	function submitRegister(){
		window.location="register.jsp";
	}
 </script>

<div class="members_login">
	<c:choose>
		<c:when test="${sessionScope.USER eq null}">
			<form id="Login" name="Login" action="login" method="post">
				<h1>
					<c:if test="${requestScope.WARN eq null}">
					简捷登录:
					</c:if>
					<c:if test="${requestScope.WARN ne null}">
						<img src="images/icons/cross.png" />&nbsp;<font color="red">${requestScope.WARN}</font>
					</c:if>
				</h1>

				<div class="login_row">
					<label class="login">
						帐号：
					</label>
					<input type="text" name="username" class="login_input" />
				</div>
				<div class="login_row">
					<label class="login">
						密码：
					</label>
					<input type="password" name="password" class="login_input" />
				</div>
				<div class="login_row">
					<a href="javascript:submitRegister();" class="register_submit"><span>免费注册</span>
					</a>
					<a href="javascript:submitValidate();" class="login_submit"><span>登录</span>
					</a>
				</div>
			</form>
		</c:when>
		<c:otherwise>
			<!-- msgbox -->
			<div id="msgbox">
				<a href="#"><img class="avatar"
						src="<%=path%>${sessionScope.USER.userHeadUrl}" />
				</a> 欢迎您：&nbsp;
				<b>${sessionScope.USER.userName }</b>
				<span>|</span>
				<a href="#">个人空间</a>
				<span>|</span>
				<a href="#">退出</a>
				<br />
				<small>You have <a href="#" class="high"><b>1</b> new
						message!</a>
				</small>
			</div>
			<!-- End of msgbox -->
		</c:otherwise>
	</c:choose>
</div>

<h1>
	Latest News
</h1>
<p class="news">
	<img src="images/calendar.gif" alt="" title="" class="left_img" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt
</p>

<p class="news">
	<img src="images/calendar.gif" alt="" title="" class="left_img" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt
</p>

<p class="news">
	<img src="images/calendar.gif" alt="" title="" class="left_img" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt
</p>

<h1>
	推荐
</h1>
<p class="clear">
	<img src="images/icon1.png" alt="" title="" class="left_img" width="48"
		height="48" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
	minim veniam, quis nostrud exercitation
</p>

<p class="clear">
	<img src="images/icon2.png" alt="" title="" class="left_img" width="48"
		height="48" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
	minim veniam, quis nostrud exercitation
</p>


<p class="clear">
	<img src="images/icon3.png" alt="" title="" class="left_img" width="48"
		height="48" />
	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
	eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
	minim veniam, quis nostrud exercitation
</p>
